coreVersion: v1
kind: Item
includeTemplates:
  - default
metadata:
  name: task
  displayName: Task
  pluralName: tasks
  displayPluralName: Tasks
  dataSource: main
  tableName: project_tasks
  titleAttribute: name
  description: Tasks
  icon: TrophyOutlined
  core: false
  performDdl: true
spec:
  attributes:
    sortOrder:
      type: int
      columnName: sort_order
      displayName: Sort Order
      description: Sort Order
      colWidth: 180
    name:
      type: string
      columnName: name
      displayName: Name
      description: Name
      length: 100
      required: true
      unique: true
      colWidth: 200
    description:
      type: string
      columnName: description
      displayName: Description
      description: Description
      length: 250
      colWidth: 200
    project:
      type: relation
      relType: manyToOne
      target: project
      inversedBy: tasks
      columnName: project_id
      displayName: Project
      description: Project
      required: true
    parent:
      type: relation
      relType: manyToOne
      target: task
      inversedBy: children
      columnName: parent_id
      displayName: Parent
      description: Parent
      colWidth: 200
    level:
      type: int
      columnName: lvl
      displayName: Level
      description: Level
#      required: true
      defaultValue: 0
      minRange: 0
    start:
      type: datetime
      columnName: start_at
      displayName: Start
      description: Start
      required: true
    end:
      type: datetime
      columnName: end_at
      displayName: End
      description: End
      required: true
    progress:
      type: int
      columnName: progress
      displayName: Progress
      description: Progress
      required: true
      minRange: 0
      maxRange: 100
    isMilestone:
      type: bool
      columnName: is_milestone
      displayName: Milestone
      description: Milestone flag
    children:
      type: relation
      relType: oneToMany
      target: task
      mappedBy: parent
      displayName: Children
      description: Children
    dependencies:
      type: relation
      relType: oneToMany
      target: dependency
      mappedBy: source
      displayName: Dependencies
      description: Dependencies
    assignments:
      type: relation
      relType: oneToMany
      target: assignment
      mappedBy: source
      displayName: Assignments
      description: Assignments
